package cmp.main;

import java.awt.Color;

import util.methods.Converters;
import util.methods.PaveProps;
import util.methods.Version;

public final class Globals {
	public static final String VERSION = Version.strPAVEver;
	public static final String DBver = Version.strDBver;
	public static final String VDATE = Version.strRelDate;
	
	public static final String PROJECTDIR = "projcmp";
	public static final String CMPDBPREFIXold = 	"CMPPAVE";
	public static final String CMPDBPREFIX =    "mTCW";
	public static final String CONFIG_FILE = "mTCW.cfg";
    public static final String HOST_FILE = "HOSTS.cfg"; 
	public static final String CmpErrorLog = "mTCW.error.log";
	public static final String PROTEINsTCW = "(is protein)";
	
	// these are duplicated in jpave.ManagerFrame.java
	public static final Color BGCOLOR = Color.WHITE;
	public static final Color FUNCTIONCOLOR = new Color(240 ,240, 255); // 
	public static final Color MENUCOLOR = new Color(229, 245, 237);	// beige
	public static final Color HELPCOLOR = new Color(245, 213, 234);	// rose
	public static final Color PROMPTCOLOR = new Color(243, 235, 227);	// light beige
	public static final Color LAUNCHCOLOR = new Color(200, 200, 240); // light purple
	
	// Compile
	public static final String PRE_ASM = "A__";
	public static final String PRE_LIB = "L__"; // RPKM from single
	public static final String PRE_DE = "P__";	// DE from single
	public static final String PRE_LIBCNT = "LS__"; // Std of RPKM of cluster
	public static final String PRE_DECNT = "PS__"; // Std of DE of cluster
	// Prefixes are slightly different between Single and Multi; these are singleTCW
	public static final String PRE_S_RPKM = "LN__";
	public static final String PRE_S_CNT = "L__";
	public static final String PRE_S_DE = 	"P_";
	// Cutoff for Pearson's Correlation Coefficient for perPCC
	public static final double PCCcutoff = 0.8;
	public static final double RPKMcutoff = 1000.0;
	public static final double DEcutoff = 0.05;
	public static final int DEnoVal = -2; 
	
	public static class Compile {	
		//CompileMain
		public final static String logDir  = "log";
		public final static String logFile = "compile.log";
		
		//LoadPAVE
		public static final String ESTScanDir = PaveProps.getExtDir() + "/ESTScan";
		public static final String ESTScanExec = PaveProps.getExtDir() +"/ESTScan/estscan";
		public static final String SMATDIR = 	PaveProps.getExtDir() + "/ESTScan/smat";
		public static final String AAfiles = "AAfiles";
		
		//Method Classes
		public static final String GROUP_FILE_BEST_RECIP = "BestRecip";
		public static final String GROUP_FILE_TRANSITIVE = "Transitive";
		
		//Summary
		public static final String overFile = "compileOverview";
	}
	
	public static class CompilePanel {
		public static final String COMBINEDFASTA = "Combined.fasta";
		public static final String BLASTTAB = "blasta.tab";
		public static final String BLASTFILTSUF = ".filt";
		public static final String BLASTDIR = "blastResults";
		public static final String BLASTFILTID = "99";
		public static final String BLASTFILTEX = "2";
		
		//PaveProp global
		public static final int numDB = 20;

		//Labels for host file
	    public static final String DATABASE_HOST_URL = "DB_host";
		public static final String DATABASE_ANNOTATE_USER = "DB_user";
		public static final String DATABASE_ANNOTATE_PASSWORD = "DB_password";
		
	    public static final String DATABASE_HOST_URL_OLD = "PAVE_host";
		public static final String DATABASE_ANNOTATE_USER_OLD = "PAVE_user";
		public static final String DATABASE_ANNOTATE_PASSWORD_OLD = "PAVE_password";

		//File/directory locations
	    public static final String TEMP_DIR = 	".mtcw";		
		public static final int WIDTH = 120;
	}
	
	public static class Methods {
		public static class BestRecip {	
			public static final String TYPE_NAME = "Best Reciprocal Hit";
			public static final String DEFAULT_PREFIX = "BR";
			public static final String OVERLAP_CUTOFF = "90";
			public static final String SIMILARITY = "97";
		}
		
		public static class UserDef {			
			public static final String TYPE_NAME = "User Defined";
			public static final String DEFAULT_PREFIX = "US";
		}
		
		public static class Transitive {			
			public static final String TYPE_NAME = "Transitive";
			public static final String DEFAULT_PREFIX = "TR";
			public static final String OVERLAP_CUTOFF = "80";
			public static final String SIMILARITY = "80";
		}
		
		public static class OrthoMCL {	
			public static final String TYPE_NAME = "OrthoMCL";
			public static final String DEFAULT_PREFIX = "OM";
			public static final int WIDTH = 120;
			public static final String INFLATION = "4";
		}
	}
	
	public static class MultiAlign { 
		public final static String DEFAULT_SOURCE_FILE_NAME = PaveProps.getExtDir() + "/muscle/SourceSequences.fasta";
		public final static String DEFAULT_TARGET_FILE_NAME = PaveProps.getExtDir() + "/muscle/MuscleAlignment.fasta";
		public final static String DEFAULT_TARGET_DIRECTORY = "muscle";
		public final static String MUSCLE_PATH = PaveProps.getExtDir() + "/muscle/muscle";
		public final static int SEQUENCE_LINE_LENGTH = 80;
	}
	
	public static class Viewer {
		public static final String DB_NAME_PREFIXold = "PAVE"; // for compiling comparison database
	    public static final String DB_NAME_PREFIX = "sTCW"; // for compiling comparison database
	}
	/****************************************
	 * static methods
	 */
	public static String saveDouble(double d) {
		return Converters.roundBoth(d, 3, 2);
	}

}
